#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "

drop table if exists edu_dta.relationship_day;
create table edu_dta.relationship_day
(
    ---------维度--------

    origin_type         string,       --线上线下
    itcast_school_id    int,            -- 校区
    school_name         string,
    itcast_subject_id   int,            -- 学科
    subject_name        string,
    origin_channel      string,         -- 来源渠道
    area                string,          --地区
    tdepart_id          int,            -- 各咨询中心,销售部门
    dep_name            string,
    clue_state          string,        --新老学员
    year_date           string ,
    month_date          string ,
    day_date            string ,
    hour_date           string ,
    ---------类型字段-------------------
     group_type string,
     customer_relationship_amount   bigint


)
comment '意向主题宽表'
row format delimited fields terminated by '\t'
stored as orc
tblproperties ('orc.compress'='snappy');


drop table if exists edu_dta.clue_day;
create table edu_dta.clue_day
(
    ---------维度--------

    origin_type         string,       --线上线下
    clue_state          string,        --新老学员
    year_date           string ,
    month_date          string ,
    day_date            string ,
    hour_date           string ,
    ---------类型字段-------------------
     group_type string,
     clue_amount bigint,
     val_clue_amount bigint
)
comment '线索主题宽表'
row format delimited fields terminated by '\t'
stored as orc
tblproperties ('orc.compress'='snappy');

